<template>
  <div style="min-width:1050px">
    <div class="leftContainer">
      <div class="cutCrads">
        <!-- 暂时先用QuestionArray模拟一下，等到接口写好了用ShowList :key记得到时候改一改 -->
        <div v-for="item in QuestionArray" :key="item" class="oneOfCutCards">
          <div class="left">
            <div class="top">
              <div class="qustionType">题型：</div>
              <div class="qustionTypeContent">{{ item.qustionType }}</div>
            </div>
            <div class="middle">
              {{ item.quetionDescription }}
            </div>
            <div class="bottom">
              <div class="updateTime">更新时间：</div>
              <div class="updateTimeContent">{{ item.updateTime }}</div>
            </div>
          </div>
          <div class="right">
            <add-to-package-button
              :resourceType="'examination'"
            ></add-to-package-button>
          </div>
          <div style="clear:both"></div>
        </div>
      </div>
      <div class="block">
        <el-pagination
          :total="QuestionArray.length"
          :current-page="ShowInfo.pageNum"
          :page-size="ShowInfo.pageSize"
          layout="prev, pager, next"
          @current-change="handleCurrentChange">
        </el-pagination>
      </div>
    </div>
    <div class="rightContainer">
      <el-dropdown>
        <span class="el-dropdown-link">
          选择题型<i class="el-icon-arrow-down el-icon--right"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>选择题</el-dropdown-item>
          <el-dropdown-item>填空题</el-dropdown-item>
          <el-dropdown-item>解答题</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>

  </div>
</template>

<script>
import AddToPackageButton from '@/components/Buttons/AddToPackageButton.vue'
export default {
  components: { AddToPackageButton },
  data: function() {
    return {
      QuestionArray: [
        {
          qustionType: '选择题',
          quetionDescription: '1.关于x的方程x2＋5x＋m＝0的一个根为－2，则另一个根是( B )' + '\n' +
          'A.－6  B.－3  C.3  D.6 ',
          updateTime: '2022-1-7'
        },
        {
          qustionType: '选择题',
          quetionDescription: '3.方程2x2－5x＋3＝0的根的情况是( B )' +
          'A.有两个相等的实数根  B.有两个不相等的实数根' +
          'C.无实数根  D.两根异号',
          updateTime: '2022-1-7'
        },
        {
          qustionType: '选择题',
          quetionDescription: '1.关于x的方程x2＋5x＋m＝0的一个根为－2，则另一个根是( B )' + '\n' +
          'A.－6  B.－3  C.3  D.6 ',
          updateTime: '2022-1-7'
        },
        {
          qustionType: '解答题',
          quetionDescription: '22.(10分)如图，C，D是半圆O上的三等分点，直径AB＝4，连接AD，AC，DE⊥AB，垂足为E，DE交AC于点F' +
            '(1)求∠AFE的度数；' +
            '(2)求阴影部分的面积(结果保留π和根号).' +

            '解：(1)连接OD，OC，∵C，D是半圆O上的三等分点，∴＝＝，∴∠AOD＝∠DOC＝∠COB＝60°，∴∠CAB＝30°，∵DE⊥AB，∴∠AEF＝90°，∴∠AFE＝90°－30°＝60°；' +
            '(2)由(1)知，∠AOD＝60°，∵OA＝OD，AB＝4，∴△AOD是等边三角形，OA＝2，∵DE⊥AO，∴DE＝，∴S阴影＝S扇形AOD－S△AOD＝－＝π－.',
          updateTime: '2022-1-7'
        },
        {
          qustionType: '填空题',
          quetionDescription: '11.点A(2,1)与点B关于原点对称，则点B的坐标是　(－2，－1)　.',
          updateTime: '2022-1-7'
        },
        {
          qustionType: '选择题',
          quetionDescription: '1.关于x的方程x2＋5x＋m＝0的一个根为－2，则另一个根是( B )' + '\n' +
          'A.－6  B.－3  C.3  D.6 ',
          updateTime: '2022-1-7'
        }

      ],
      ShowList: [],
      // 获取展示列表对象
      ShowInfo: {
        // 当前的页数
        pageNum: 1,
        // 每页显示的条数
        pageSize: 5
      }
    }
  },
  methods: {
    getsearchInput(val) {
      alert(val)
    },
    // 获取展示列表 等待后端接口
    async getAdviceList() {
      // const { data: result } = await getAdvice(this.adviceInfo)// 解构数据
      // this.ShowList = result.data.ShowList
      // this.total = result.data.total
    },
    // 监听页码值改变的事件
    handleCurrentChange(newPage) {
      this.adviceInfo.pageNum = newPage
      this.getAdviceList()
    }
  }
}
</script>

<style scoped>
.leftContainer{
  float: left;
}
.rightContainer{
  color:rgb(34, 52, 110) ;
  min-width: 100px;
  margin-left: 40px;
  font-family: 'Roboto', sans-serif;
  font-size: 30px;
  font-weight: bolder;
  float: right;
}
.cutCrads{
  min-height: 230px;
}
.oneOfCutCards{
  background-color: rgb(254, 254, 254);
  width: 900px;
  min-height: 150px;
  margin-bottom: 20px;
  grid-column: 3;
  box-shadow: 1px 1px 5px rgb(233, 226, 252);
  padding-bottom: 10px;
  position: relative;
  /* 触发BFC, 防止float塌陷*/
  overflow : hidden;
}

.oneOfCutCards:hover{
  box-shadow: 2px 2px 10px rgb(233, 226, 252);
  transform:translateY(1px);
}
.left{
  width:90%;
  float: left;
  left:0;
  height: 100%;
}
.right{

  top:15%;
  right: 0;
  width: 10%;
  height: 100%;
  float: right;
  /* transform:translateY(-50%);
  top:50%; */

  padding-left: 22px;
  position: absolute;

}
.top{
  height: 60px;
  width: 100%;
}
.qustionType{
  padding-left:20px ;
  padding-top: 20px;
  display: inline-block;
  font-family:  'Roboto', sans-serif;
  font-size: 18px;
  font-weight: bold;
  color: rgb(34, 52, 110);
}
.qustionTypeContent{
  display: inline-block;
  font-size: 17px;

  left: 80px;

  color: rgb(34, 52, 110);
}
.middle{
  padding-left: 20px;
  padding-bottom: 50px;
  width:100%;
  height: auto;
  min-width: 100px;
  color: rgb(34, 52, 110);
}
.bottom{
  position:absolute;
  left:20px;
  width: 90%;
  bottom:10px;
}
.updateTime{
  display: inline-block;
  color: rgb(149, 149, 149);
  font-size: 14px;
}
.updateTimeContent{
  display: inline-block;
  color: rgb(149, 149, 149);
  font-size: 13px;
}

/* 分页区域 */
.block{
  margin-bottom: 50px;
}
.el-pagination {
    text-align: center;
}
.el-pagination /deep/ .el-pager  li.active{
  color:rgb(134, 98, 241) ;
}
.el-pagination /deep/ .el-pager :hover{
  color:rgb(134, 98, 241) ;
}

/* 筛选下拉框区域 */
.el-dropdown-link {
    cursor: pointer;

  }
.el-icon-arrow-down {
    font-size: 12px;
  }
.el-dropdown-menu__item:not(.is-disabled):hover{
      background-color: rgb(241, 243, 252) !important;
      color: #333333 !important;
}
</style>
